<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
	FB.init({
	 appId  : '463995797026190',
	 status : true, // check login status
	 cookie : true, // enable cookies to allow the server to access the session
	 xfbml  : true// parse XFBML
	 });
	FB.Canvas.setSize({ width: 800, height: 1000 });
 </script>
<?php
	$noidungchiase = $this->noidungchiase;
	$listPageLike = $this->listPageLike;
?>
<input type="button" name="themndmoi" value="Thêm bài" onclick="window.location.href='noidungchiase/add'"/>
<input type="hidden" id="linkpageshare" value=""/>
<table border="1" class="spdg">
	<tr>
		<th width="20">STT</th>
        <th width="150">Tiêu đề</th>
		<th width="150">Mô tả</th>
        <th width="50">Hình ảnh</th>
		<th width="50">Công Cụ</th>
	</tr>
	<?php
		for($i=0; $i<count($noidungchiase); $i++)
		{
	?>
	<tr>
		<td align="center"><?php echo $i+1 ?></td>
        <td><?php echo $noidungchiase[$i]['tieude'] ?></td>
		<td><?php echo $noidungchiase[$i]['mota'] ?></td>
        <td align="center">
			<!--
			<img src="<?php echo APP_DOMAIN?>/application/layouts/tmplikepage/images/noidung/<?php echo $noidungchiase[$i]['hinhanh'] ?>" class="hinhchinh_product">
			-->
			<img src="<?php echo $noidungchiase[$i]['hinhanh']?>" class="hinhchinh_product">
		</td>
        
        <td align="center"  valign="top" style="padding-top:30px">
			<a href="noidungchiase/chitiet?idnd=<?php echo $noidungchiase[$i]['idnoidung']?>"><img title="Chi Tiết Nội dung" alt="ct" src="<?php echo APP_DOMAIN ?>/application/templates/giaodien_admin/images/sua.png"></a>
			<a onclick="return confirm('Bạn có chắc chắn muốn xóa không.')"  href="<?php echo APP_DOMAIN ?>/admin/noidungchiase/delete?idnd=<?php echo $noidungchiase[$i]['idnoidung'] ?>"><img title="Xóa Sản Phẩm" alt="xoa" src="<?php echo APP_DOMAIN ?>/application/templates/giaodien_admin/images/xoa.png"></a>
			<select title="Chọn Page cần đăng lên tường." onchange="chonLinkPage(this.value, '<?php echo $noidungchiase[$i]['idnoidung'] ?>')" name="listPageLike" style="width:20px; padding: 0 5px 0 0; width: 25px;">
				<option value='0'>Chọn Page cần chia sẻ</option>
				<?php
					for($j=0; $j<count($listPageLike); $j++)
					{
						$namePage = $listPageLike[$j]['pagename'];
						$idnd = base64_encode(base64_encode($noidungchiase[$i]['idnoidung']));
						$linkPage = $listPageLike[$j]['linkpage'].'/app_'.APP_ID.'?app_data='.$idnd;
						echo "<option value='$linkPage'>$namePage</option>";
					}
				?>
			</select>
			
			<?php
				$tieude = $noidungchiase[$i]['tieude'];
				$caption = $noidungchiase[$i]['caption'];
				$mota = $noidungchiase[$i]['mota'];
				
				$hinhanh = $noidungchiase[$i]['hinhanh'];
			?>
			<br/>
			<a class="danglentuong" id="idnoidung<?php echo $noidungchiase[$i]['idnoidung']?>" onclick="danglentuong(<?php echo "'$tieude', '$caption', '$mota', document.getElementById('linkpageshare').value, '$hinhanh'"; ?>)" href="javascript:;"><img title="Chia sẻ lên tường" alt="tt" src="<?php echo APP_DOMAIN ?>/application/templates/giaodien_admin/images/sharefb.jpg"></a>
		</td>
	</tr>
	<?php } ?>

</table>
<input type="button" name="themndmoi" value="Thêm bài" onclick="window.location.href='noidungchiase/add'"/>